import http from '@/utils/http'
import router from '@/router/router'
export default {
    getButlerList(context){
        return http.post('/userManage/admin/list',{})
            .then((res) => {
                if(res.status == 0 && res.code == "1000002"){
                    router.push('/login');
                }else{
                    context.commit('setButlerList',res.data);
                }                
            })
            .catch(err => console.log(err));
    },
    getBuliterRechargeHistory(context,params){
        return http.post('/managePay/admin/rechargeRecordList',params)
            .then(res => {
                context.commit('setBuliterRechargeHistory',res.data);
            })
            .catch(err => console.log(err));
    },
    updateButlerInfo(context,params){
        return http.post('/userManage/admin/update',params)
            .catch(err => console.log(err));
    }
}